<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../css/common.css">
    <script src="../js/jquery-3.1.1.min.js"></script>
    <script src="../js/myAjax.js"></script>

</head>
<script>
    $(function () {
        let data= myAjax("/common", {}, "get", {});
        console.log(data);
        let company = data[0].object.companyModel;
        let nav = data[0].object.navList;

        setCompany(company);
        setNav(nav);
    })

    function setCompany(company) {
        $("#logo").attr("src", company.logo);
        $("#phone").html(company.phone);
        $("#net").html("网址:" + company.net);
        // 邮箱:admin@ 163.com联系电话: 028-80000000(座机)
        $("#email").html("邮箱:" + company.email + "联系电话:" + company.linePhone);
        $("#address").html(company.address);
        $("#version").html(company.version);
    }

    function setNav(data) {
        let html = '';
        for (let i = 0; i < data.length; i++) {
            html += '<a href="' + data[i].href + '">\n' +
                '            <div>' + data[i].title + '</div>\n' +
                '            </a>';
        }

        $("#nav").html(html);
    }

</script>
<body>
<div class="foot">
    <hr>
    <div>

        <p id="net"></p>
        <p id="email"> </p>
        <p id="address"></p>
        <p id="version"></p>

    </div>

</div>
</body>
</html>